package com.shyroke.daydayzhuanapi.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;

@Getter
@Setter
@Entity
@Table(name = "rool")
public class RoleEntity extends BaseEntity implements Serializable{
    private String name;

    @ManyToMany(cascade = CascadeType.ALL)
    @JoinTable(name = "role_permission",joinColumns = @JoinColumn(name = "roleid"),
    inverseJoinColumns = @JoinColumn(name = "permissionid"))
    private Set<PermissionEntity> permissions;
}